home *** CD-ROM | disk | FTP | other *** search
Text File | 1988-06-14 | 2.4 KB | 136 lines | [TEXT/KAHL] |
- Case On
- Print Off
- Include 'QuickEqu.a'
- Include 'SysEqu.a'
- Include 'traps.a'
- Print On
-
- Export Draw
-
- ;*********************************************************
- ; 4/2/88 FFA — Added _ClipRect call
- ;*********************************************************
-
-
- ;**************************************
- ; Cell data structure
- ;**************************************
- CellData Record 0
- cdString DS.B 1 ; Length byte of a string.
- EndR
-
- ;**************************************
- ; Stack structure
- ;**************************************
- drFrame Record {A6Save},Decr
- cellWid DS.W 1
- cellHt DS.W 1
- cRect DS.L 1
- hCells DS.L 1
- downSet DS.L 1
- offset DS.L 1
- rtnAdr DS.L 1
- A6Save DS.L 1
- oldPen DS.B psRec ; Constant = 18 in QuickEqu
- lclSize Equ *
- EndR
-
- Draw Proc
- With drFrame,CellData
-
- Link A6,#lclSize
- MoveM.L D3/D4/A2/A3,-(SP)
-
- Pea oldPen(A6)
- _GetPenState
- _PenNormal
- Pea grayPat
- _PenPat
-
- MoveA.L cRect(A6),A3 ; A3 <- Rect
- Move.L A3,-(SP)
- _EraseRect ; Blank the Rect
-
- Move.L A3, -(SP)
- _ClipRect
-
- Move.W left(A3),D0
- AddQ.W #2,D0
- Move.W D0,-(SP) ; Margin + left
- Move.L downSet(A6),D0
- Add.W top(A3),D0 ; Top + clearance
- Move.W D0,-(SP)
- _MoveTo
-
- MoveA.L hCells(A6),A0 ; cells (handle)
- Move.L A0,D4 ; Save userHandle
- _HLock
- MoveA.L (A0),A0
- Move.L offset(A6),D0 ; offset
- Lea $0(A0,D0.L),A2 ; A2 <- cell data
-
- Move.L A2, -(SP) ; Push addr of string
- _DrawString ; Draw it.
-
- Move.L D4,A0 ; Unlock userHandle
- _HUnlock
-
- Move.L (A3),D4 ; D4 = topLeft
- Move.L D4,D3 ; Determine full-cell rect.
- Add.W cellWid(A6),D3
- Swap D3
- Add.W cellHt(A6),D3
- Swap D3 ; D3 = botRight
- Sub.L OneOne,D3
- Move.L D3,D0 ; Bottom...
- Move.W D4,D0 ; ... Left
- Move.L D0,-(SP)
- _MoveTo
- Move.L D3,-(SP) ; Bottom Right
- _LineTo
- Move.L D4,D0 ; Top...
- Move.W D3,D0 ; ...Right
- Move.L D0,-(SP)
- _LineTo
-
- Pea oldPen(A6)
- _SetPenState
-
- MoveM.L (SP)+,D3/D4/A2/A3
- Unlk A6
- Rts
- grayPat DC.B $AA,$55,$AA,$55,$AA,$55,$AA,$55
-
- EndWith
- EndProc
-
- ;*********************************************************
- ; Defined here so we don't have to link with
- ; the MPW Libraries:
- ;*********************************************************
-
- HLock Proc Export
- Move.L 4(SP), A0
- _HLock
- Rts
- EndProc
-
- HUnlock Proc Export
- Move.L 4(SP), A0
- _HUnlock
- Rts
- EndProc
-
- PtrToHand Proc Export
- Move.L 4(SP), A0 ; source Pointer
- Move.L 12(SP), D0 ; Length of source
-
- _PtrToHand
-
- Move.L 8(SP), A1 ; Pointer to destination handle
- Move.L A0, (A1) ; Fill destination with handle
- Rts
- EndProc
-
- End
-